POV-Ray : Newsgroups : povray.general : POV-Ray Includes - Standards : Re: POV-Ray Includes - Standards Server Time
31 Jul 2024 22:09:56 EDT (-0400)
  Re: POV-Ray Includes - Standards  
From: Warp
Date: 19 Dec 2006 11:41:26
Message: <45881636@news.povray.org>
ingo <ing### [at] tagpovrayorg> wrote:
> Instead of standardising units why not require 
> a "small scale object" to fit in a centerd 1x1x1 pov-unit cube. Then any 
> user can scale the object to fit in a scene.

  Btw, there's one thing to consider when predeclaring an object which is
later to be scaled:
  Media density is not scaled with the object.

  There are two possible behaviours of media density, both of which have
their rationale:

  1) It is not affected by 'scale' (as it currently isn't). This is logical
when you think about an example case: If you have a glass of colored water,
it will filter light passing through it by some amount. If you take a glass
of the same colored water but which is twice as big, it will filter *more*
the light passing through it (because the light now traverses a larger
distance through the water). This is how POV-Ray currently behaves.

  2) Density is affected by scale. This would be useful if you want to
eg. scale the entire scene to a different size, while keeping it looking
exactly the same. In other words, you might want to make everything 10 times
bigger (including the camera location etc), after which everything should
look identical, just all internal values are now ten-fold.
  However, if you have an object with media in it, its density will currently
not be scaled, and you will end up with a much stronger media density, and
thus the object in question will look very different (with a 10 times
stronger media).

  POV-Ray currently behaves as 1), but if you want the 2) behaviour, you'll
have to manually scale the media density by the inverse of the object scale
(IOW. if you scale the object 10 times bigger you have to divide the media
density by 10).

  This consitutes a small problem with a predeclared object in an include
file which has media inside it. If you just instantiate the object and
scale it, and what you want is for the media to look identical regardless
of scale, that won't do it.
  But on the other hand, you might *want* the media density to not to be
scaled with the object in order to get a more realistic result in certain
situations (think of the glass with colored water).

  One possible solution to this is to make such objects #macros, one of
which parameters is the desired scale of the object. The macro will then
inversely scale the density of the media. This way if the user wants the
density to be scaled, he gives the scale as macro parameter, and if he
doesn't want it to be scaled, he just gives a "1" as scale parameter and
scales the object in his own code.
  (Combinations of both are of course possible too, such as when you want
differently sized colored water glasses, but the base scale of the scene
is very different from what the original object was sized to.)

  Of course uneven scaling is an interesting question in its own, but
let's not go that deep, shall we?

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.